home *** CD-ROM | disk | FTP | other *** search
/ AGA Toolkit '97 / The AGA Toolkit '97.iso / text / misc / port / string / strcmp.s < prev    next >
Encoding:
Text File  |  1996-09-07  |  466 b   |  27 lines

  1.  
  2.     XDEF    StrCmp
  3.  
  4. ; StrCmp() - Compares two strings in A0 and A1.
  5.  
  6. ; Result:
  7. ; D0 = 0 if they are equal, non-zero if not.
  8.  
  9. StrCmp:
  10.         cmpm.b  (a0)+,(a1)+
  11.         beq.b   .NullCheck
  12.         bra.b   .NotEqual
  13.  
  14. .NullCheck:
  15.         tst.b   (a0)
  16.         bne.b   StrCmp
  17.         tst.b   (a0)
  18.         bne.b   .NotEqual
  19.         tst.b   (a1)
  20.         bne.b   .NotEqual
  21.         moveq   #0,d0
  22.         rts
  23.  
  24. .NotEqual:
  25.         moveq   #-1,d0
  26.         rts                         
  27.